<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php
error_reporting(E_ALL ^ E_DEPRECATED);
session_start();
$conn=mysql_connect("localhost","root","xbsmpasswd") or die("数据库服务器连接错误".mysql_error());
mysql_select_db("wechat",$conn) or die("数据库访问错误".mysql_error());
mysql_query("set names utf8");
$ID=$_SESSION['id'];
$name= $_POST['name'];
$phone = $_POST['phone'];
$position= $_POST['position'];
$department = $_POST['department'];
$plate = $_POST['plate'];
$sql = "UPDATE mail_list SET name = '$name' , phone= '$phone' , position = '$position' , department = '$department',plate='$plate'  WHERE id = '$ID' ;
";
 if (!mysql_query($sql,$conn))
 {
  echo "<script language='javascript'>alert('修改失败！');history.back();</script>";
 }
 echo "<script language='javascript'>alert('修改成功！');history.go(-2);;</script>";
  //关闭连接
 mysql_close($conn)



?>